edited mathematics function in subject controller