added new file and re-wrote code