first buggy version of checkLeft