Almost working basic version