Add working functions
Add comments and improve indentation