Simplified the code

I removed the redundancy in float and line.split()