Updated demo and added ghosting, vertical and horizontal restriction and carried out some refactoring.