Added selltype
Merge with Paulo changes