Added basic rendering and fixed a bug