completed with bug fixes