Merge with Mario's code

1. Merge with Mario's changes
2. Add pospay part