reading from file and function parsing