Combined if & else statements into one, added comment about setting length