added 'else if' and 'else' statements