from tablet

added code - contains bugs