complete functionality, could still use a clean up.