Add more comments and implement sqldf way of reading and filtering data