converting it to prototype