Fixed #13. Fixed #14. Added shifting and gates