cleaning up code. adding function jobs functionality