fixed typo, optimized a bit