initial revision (messy but working)
merging with new repo