Added getMLA function and cleaned up