first version all in one file