changed format from if to switch. However, alignLine still doesn't work