Changed the bit operations and added some getters