finished basic functionality