put everything together, not tested