Got functionality from tutorial working