WORKS, added comments

begin making modular function