[Einthusan] Implemented a function pointer idea rather than a long if-elif block.

- Need to test this though