finished major functionality