Changed if statements to case statement and added a return to marginShorthand