Removed commented code and fixed a multi-return function