Removed debug log from commit, improved implementation