Refactor SL methods with comments, fix makefile