Merged two functions in one file