Added optimitizations