refactored more to fit critera