Implement subtruct function