Added portability and new class for graphics