More readable code, file reading prototype added