Preconditions added
using Preconditions where possible