little changes based on @bmuschko comments