added utility functions into body of code