performance upgrade and added more functionalities like arrow press