refactored to fit into program