basic functionality almost achieved