Transfer

Whole code from betaquantum is transfered