added checkout functionality, errors are prone