Changed code to be more inline with existing style