Documented & cleaned code