finished basic implentation