added seperator method to clean up main loop