Initial commit

Added optimization codes.