added type inference for let construct