better implementation of keyboard startposition