cleaned up code even more and added return statements to change_data