More work on this... fixing some problems