Used to handle code safely, especially when opening a file
fun readAFile(reader: BufferedReader): Int?
{
try{
val line = reader.readline
return line.toString()
}
catch(e : StringFormatException){
return null
}
finally{
//Cleanup
reader.close()
}
}