Some optimizations to Pocman