Before the merge
merged with luren's code
Merged with Luren