placed class and functions in a separate file