better handling of edge cases...