Modularized code, added frame buffer, change UI