wrapped up, now needs testing