Optimised for performance by using vectors and constructing data frame at the end